<?
class Date {
	protected $date_;
	
	public function __construct($date = -1) {
		if ($date == -1) $date = strtotime("now");
		$this->set($date);
	}
	
	public function get() { return $this->date_; }
	public function set($date) { $this->date_ = $date; }
	
	public function toMySQLStr() { return date("Y-m-d H:i:s", $this->date_); }
	public static function fromMySQLStr($str) { return new Date(strtotime($str)); }
	
	public function toRFC822Str() { return date("D, d M Y H:i:s T", $this->date_); }
}
?>
